package com.charging.business.enums;

/**
 * @author JerryLu
 * @date 2024/8/26 11:33
 * @description 车道出入口特情代码类
 */
public enum SpecialSituation {

    TYPE1("1", "OBU电量低"),
    TYPE41("41", "ETC卡与OBU车牌(含颜色)不符"),
    TYPE51("51", "出入口车辆车型不符"),
    TYPE52("52", "出入口车牌(含颜色)不符"),
    TYPE60("60", "入出口轴数不一致"),
    TYPE63("63", "计费模块查询费率返回失败"),
    TYPE68("68", "计费金额异常"),
    TYPE116("116", "节假日免费"),
    TYPE111("111", "U型车拦截"),
    TYPE133("133", "小于6轴其他情况拦截转人工"),
    TYPE134("134", "大件运输车拦截转人工"),
    TYPE135("135", "其他情况拦截转人工"),
    TYPE144("144", "使用最小费额计费"),
    TYPE145("145", "紧急车辆通行");

    private final String value;
    private final String description;

    SpecialSituation(String value, String description) {
        this.value = value;
        this.description = description;
    }

    // 用于从字符串获取枚举实例
    public static SpecialSituation fromValue(String value) {
        for (SpecialSituation type : values()) {
            if (type.getValue().equalsIgnoreCase(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown vehicle type: " + value);
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }
}
